package com.learn.threadpool;

import com.learn.Util.TimeUtils;

import java.util.concurrent.Callable;

/**
 * 测试线程
 */
public class MyThread2 implements Callable<String> {

    public int index;

    public MyThread2(int index) {
        this.index = index;
    }

//    @Override
//    public void run() {
//        System.out.println(TimeUtils.getDateStr() + " Thread-" + Thread.currentThread().getName() + "  " + index);
//    }

    @Override
    public String call() throws Exception {
        String name = Thread.currentThread().getName();
        System.out.println(TimeUtils.getDateStr() + " Thread-" + name + "  " + index);
        return name;
    }
}
